from . import utils
from .routes import Route
from .storage import FileStorage
from .export import Export
from .checker import Checker
from .export import execute
from .vfs.vos import OS
from .vfs.vshutil import Shutil
from server.userobj import User

# neutron plugin api 入口


class Plugin():
    def __init__(self, file_route: str):
        self.plugid = utils.search_plugin_path(file_route)
        if (self.plugid is None):
            raise OSError("Plugin path not found")  # 无法检测插件目录

        # 设置api
        self.route = Route(self.plugid)
        # self.storage = Storage(self.plugid)
        self.filestorage = FileStorage(self.plugid)
        self.export = Export(self.plugid)
        self.checker = Checker(self.plugid)

        # 附加信息
        self.after_run: list[function] = []
